import Vue from "vue"
import Toast from './Toast.vue'

const obj = {}

obj.install = function (Vue) {
  //创建组件构造器
  const toastConstructor = Vue.extend(Toast)
  //实例化
  const toast = new toastConstructor()
  //手动挂载虚拟dom
  toast.$mount(document.createElement('div'))
  document.body.appendChild(toast.$el)


  Vue.prototype.$toast = toast
}

export default obj